package com.cloud.pay;

import com.cloud.common.bean.ResultInfo;
import com.cloud.common.sentinel.Sentinel;
import com.cloud.pay.dto.PayParamDTO;
import com.cloud.pay.dto.RefundParamDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 支付服务提供者
 */
@Sentinel
@FeignClient(name = "cloud-pay", contextId = "PayProvider")
public interface PayProvider {
    /**
     * 获取支付二维码
     *
     * @param paramDTO
     * @return ResultInfo
     */
    @PostMapping("/pay/getQrcode")
    ResultInfo<String> getQrcode(@RequestBody PayParamDTO paramDTO);

    /**
     * 预支付下单
     *
     * @param paramDTO
     * @return ResultInfo
     */
    @PostMapping("/pay/prepay")
    ResultInfo<String> prepay(@RequestBody PayParamDTO paramDTO);

    /**
     * 退款
     *
     * @param paramDTO
     * @return ResultInfo
     */
    @PostMapping("/pay/refund")
    ResultInfo<String> refund(@RequestBody RefundParamDTO paramDTO);
}
